package cloudgamesaumysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/9/19 20:15
*/

// CGGameAUConversionCode 云游戏AU兑换码表
type CGGameAUConversionCode struct {
	ID                         int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	BatchID                    string         `json:"batch_id" gorm:"column:batch_id;type:varchar(32);not null;default:'';comment:生成批次ID"`
	ConversionCode             string         `json:"conversion_code" gorm:"column:conversion_code;type:varchar(500);not null;default:'';comment:兑换码"`
	ActivityTitle              string         `json:"activity_title" gorm:"column:activity_title;type:varchar(200);not null;default:'';comment:活动标题"`
	PackageContent             string         `json:"package_content" gorm:"column:package_content;type:varchar(600);not null;default:'';comment:礼包内容"`
	ConvertibilityTime         time.Time      `json:"convertibility_time" gorm:"column:convertibility_time;type:datetime;default:null;comment:可兑换时间"`
	FinishTime                 time.Time      `json:"finish_time" gorm:"column:finish_time;type:datetime;default:null;comment:截至时间"`
	TotalNumber                int64          `json:"total_number" gorm:"column:total_number;type:bigint;not null;default:0;comment:总次数"`
	UsedNumber                 int64          `json:"used_number" gorm:"column:used_number;type:bigint;not null;default:0;comment:已用次数"`
	Proposer                   string         `json:"proposer" gorm:"column:proposer;type:varchar(32);not null;default:'';comment:申请人"`
	Status                     int            `json:"status" gorm:"column:status;type:tinyint;not null;default:0;comment:当前状态（0待核销/1已核销/2使用中/3已过期/4已终止）"`
	UsedTime                   time.Time      `json:"used_time" gorm:"column:used_time;type:datetime;default:null;comment:核销时间"`
	GenerateConversionCodeType int            `json:"generate_conversion_code_type" gorm:"column:generate_conversion_code_type;type:tinyint;not null;default:0;comment:兑换码生成类型；1生成兑换码按钮；2批量生成兑换码按钮"`
	CloudCoupon                int64          `json:"cloud_coupon" gorm:"column:cloud_coupon;type:bigint;not null;default:0;comment:云玩点数；实际上后端会在转化为毫秒再计算"`
	CloudCouponProposer        string         `json:"cloud_coupon_proposer" gorm:"column:cloud_coupon_proposer;type:varchar(32);not null;default:'';comment:配置云玩点数的操作人；如果还为配置，前端显示 暂无"`
	CreatedAt                  time.Time      `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt                  time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt                  gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGameAUConversionCode) TableName() string {
	return "cg_game_au_conversion_code"
}
